package s47.dqj.dao;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import s47.dqj.bean.MedicalType;
/**
 * 8.药品种类表
 * @author Administrator
 *
 */
@Repository("medicalTypeDaoImpl")
public class MedicalTypeDaoImpl extends HibernateDaoSupport implements MedicalTypeDaoInf{

	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalTypeDaoInf#setSupperSessionFactory(org.hibernate.SessionFactory)
	 */
	@Override
	@Resource(name="sessionFactory")
	public void setSupperSessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalTypeDaoInf#findAll()
	 */
	@Override
	public List<MedicalType> findAll(){
		String hql="from MedicalType";
		return getHibernateTemplate().find(hql);
	}
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalTypeDaoInf#save(s47.dqj.bean.MedicalType)
	 */
	@Override
	public void save(MedicalType medicalType){
		getHibernateTemplate().save(medicalType);
	}
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalTypeDaoInf#update(s47.dqj.bean.MedicalType)
	 */
	@Override
	public void update(MedicalType medicalType){
		getHibernateTemplate().update(medicalType);
	}
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalTypeDaoInf#delete(s47.dqj.bean.MedicalType)
	 */
	@Override
	public void delete(MedicalType medicalType){
		getHibernateTemplate().delete(medicalType);
	}
}
